package widget.book.viewer
{
	import flash.display.Shape;
	import flash.display.Sprite;
	
	import widget.book.manager.BookManager;
	
	public class FlipMaskViewer extends Sprite{
		private var masker:Shape = null;
		
		public function FlipMaskViewer()
		{
			super();
			init();
		}
		
		public function init():void {
			var manager:BookManager = BookManager.getInstance();
			masker = new Shape();
			masker.graphics.beginFill(0);
			masker.graphics.drawRect(0, 0, manager.bookModel.width, manager.bookModel.height);
			masker.graphics.endFill();
			addChild(masker);
			
			masker.width = manager.bookModel.width * 1.5;
			masker.height =manager.bookModel.height * 4;
			masker.y = -masker.height /2;
		}
		
		public function update():void {
			masker.width = BookManager.getInstance().bookModel.width;
			masker.height = BookManager.getInstance().bookModel.height;
			masker.y = 0;
			this.scaleX = 1;
			this.scaleY = 1;
			this.x = 0;
			this.y = 0;
			this.rotation = 0;
		}
	}
}